home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2005 Utilities / CHIP Utilities 2005.7z / CHIP Utilities 2005.iso / CHIP Utilities / Zarzadzanie i bezpieczenstwo systemu / MBSA / MBSASetup-EN.msi / Data.Cab / cmdDetailReport.xsl < prev    next >
Extensible Markup Language  |  2004-08-13  |  7KB  |  228 lines

  1. <?xml version="1.0"?> 
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4. <xsl:variable name="Assessment">
  5.     <c score="1" text="Incomplete Scan"/>
  6.     <c score="2" text="Severe Risk"/>
  7.     <c score="3" text="Potential Risk"/>
  8.     <c score="4" text="Security FYIs"/>
  9.     <c score="5" text="Strong Security"/>
  10.     <c score="6" text="Check Not Performed"/>
  11.     <c score="7" text="Additional Information"/>
  12. </xsl:variable>
  13. <xsl:variable name="CR" select="'
  14. '"/>
  15. <xsl:variable name="FileName" select="'file name here'"></xsl:variable>
  16.     
  17. <xsl:template match="SecScan">
  18.  
  19. <xsl:param name="assess" select="@Grade"/>                    
  20. Computer name: <xsl:value-of select="@Domain"/>\<xsl:value-of select="@Machine"/>
  21. IP address: <xsl:value-of select="@IP"/>
  22. Security report name: <xsl:value-of select="$FileName" />
  23. <xsl:if test="@SUSServer and @SUSServer != ''">
  24. SUS Server: <xsl:value-of select="@SUSServer" />
  25. </xsl:if>
  26. Scan date: <xsl:value-of select="@Date"/>
  27. <xsl:choose><xsl:when test="@HotfixDataVersion">
  28. Security update database version: <xsl:value-of select="@HotfixDataVersion"/>
  29. <xsl:if test="NewerVersions/@XmlVer"> ** New security updates are available; rescan to use security update database version <xsl:value-of select="NewerVersions/@XmlVer"/> **</xsl:if></xsl:when></xsl:choose>
  30. <xsl:for-each select="//Check[@DataVersionName and @DataVersion]">
  31. <xsl:value-of select="$CR"/>
  32. <xsl:value-of select="@DataVersionName"/><xsl:text> </xsl:text><xsl:value-of select="@DataVersion"/>
  33. </xsl:for-each>
  34.  
  35. Security assessment: <xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$assess]/@text"/>
  36.  
  37. <xsl:choose>
  38. <xsl:when test="Check[@Type='5']">
  39.  
  40.   Security Updates Scan Results
  41.     <xsl:choose>
  42.     <xsl:when test="Check[@Type='5'][@Cat='1']">
  43.         <xsl:for-each select=".">
  44.             <xsl:apply-templates select="Check[@Type='5'][@Cat='1']">
  45.             </xsl:apply-templates>
  46.         </xsl:for-each>    
  47.     </xsl:when>
  48.     </xsl:choose>
  49. </xsl:when>
  50. </xsl:choose>
  51. <xsl:choose>
  52. <xsl:when test="Check[@Type='1']">
  53.  
  54.   Operating System Scan Results 
  55.     <xsl:choose>
  56.     <xsl:when test="Check[@Type='1'][@Cat='1']">
  57.     Vulnerabilities
  58.         <xsl:for-each select=".">
  59.             <xsl:apply-templates select="Check[@Type='1'][@Cat='1']">
  60.             </xsl:apply-templates>
  61.         </xsl:for-each>    
  62.     </xsl:when>
  63.     </xsl:choose>
  64.     <xsl:choose>
  65.     <xsl:when test="Check[@Type='1'][@Cat='2']">
  66.     Additional System Information
  67.         <xsl:for-each select=".">
  68.             <xsl:apply-templates select="Check[@Type='1'][@Cat='2']">
  69.             </xsl:apply-templates>
  70.         </xsl:for-each>
  71.     </xsl:when>
  72.     </xsl:choose>
  73. </xsl:when>
  74. </xsl:choose>
  75. <xsl:choose>
  76. <xsl:when test="Check[@Type='3']">
  77.  
  78.   Internet Information Services (IIS) Scan Results
  79.     <xsl:choose>
  80.     <xsl:when test="Check[@Type='3'][@Cat='4']">
  81.         <xsl:for-each select=".">
  82.             <xsl:value-of select="Check[@Type='3'][@Cat='4']/Advice" />
  83.         </xsl:for-each>
  84.     </xsl:when>
  85.     <xsl:when test="Check[@Type='3'][@Cat='1']">
  86.     Vulnerabilities
  87.         <xsl:for-each select=".">
  88.             <xsl:apply-templates select="Check[@Type='3'][@Cat='1']">    
  89.             </xsl:apply-templates>
  90.         </xsl:for-each>
  91.     </xsl:when>
  92.     </xsl:choose>
  93.     <xsl:choose>
  94.     <xsl:when test="Check[@Type='3'][@Cat='2']">
  95.     Additional System Information
  96.         <xsl:for-each select=".">
  97.             <xsl:apply-templates select="Check[@Type='3'][@Cat='2']">
  98.             </xsl:apply-templates>
  99.         </xsl:for-each>
  100.     </xsl:when>
  101.     </xsl:choose>
  102. </xsl:when>
  103. </xsl:choose>
  104. <!-- One tag per SQL Instance, MBSA V1.1 and later -->
  105. <xsl:choose>
  106.     <xsl:when test="SQLInstance">
  107.  
  108.   SQL Server Scan Results<xsl:for-each select="."><xsl:apply-templates select="SQLInstance"/></xsl:for-each>
  109.     </xsl:when>
  110. </xsl:choose>
  111. <xsl:choose>
  112. <xsl:when test="Check[@Type='2']">
  113.  
  114.   SQL Server Scan Results
  115.     <xsl:choose>
  116.     <xsl:when test="Check[@Type='2'][@Cat='4']">
  117.         <xsl:for-each select=".">
  118.             <xsl:value-of select="Check[@Type='2'][@Cat='4']/Advice" />
  119.         </xsl:for-each>
  120.     </xsl:when>
  121.     <xsl:when test="Check[@Type='2'][@Cat='1']">
  122.     Vulnerabilities
  123.         <xsl:for-each select=".">
  124.             <xsl:apply-templates select="Check[@Type='2'][@Cat='1']">        
  125.             </xsl:apply-templates>
  126.         </xsl:for-each>    
  127.     </xsl:when>
  128.     </xsl:choose>
  129.     <xsl:choose>
  130.     <xsl:when test="Check[@Type='2'][@Cat='2']">
  131.     Additional System Information
  132.         <xsl:for-each select=".">
  133.             <xsl:apply-templates select="Check[@Type='2'][@Cat='2']">    
  134.             </xsl:apply-templates>
  135.         </xsl:for-each>    
  136.     </xsl:when>
  137.     </xsl:choose>
  138. </xsl:when>
  139. </xsl:choose>
  140. <xsl:choose>
  141. <xsl:when test="Check[@Type='4']">
  142.  
  143.   Desktop Application Scan Results
  144.     <xsl:choose>
  145.     <xsl:when test="Check[@Type='4'][@Cat='1']">
  146.     Vulnerabilities
  147.         <xsl:for-each select=".">
  148.             <xsl:apply-templates select="Check[@Type='4'][@Cat='1']">
  149.             </xsl:apply-templates>
  150.         </xsl:for-each>
  151.     </xsl:when>
  152.     </xsl:choose>
  153.     <xsl:choose>
  154.     <xsl:when test="Check[@Type='4'][@Cat='2']">
  155.     Additional System Information
  156.         <xsl:for-each select=".">
  157.             <xsl:apply-templates select="Check[@Type='4'][@Cat='2']">
  158.             </xsl:apply-templates>
  159.         </xsl:for-each>
  160.     </xsl:when>
  161.     </xsl:choose>
  162. </xsl:when>
  163. </xsl:choose>
  164. </xsl:template>
  165.     
  166. <!-- SQL Instance section -->
  167. <xsl:template match="SQLInstance">
  168.  
  169.    Instance <xsl:value-of select="@Name"/>
  170.     <xsl:choose>
  171.     <xsl:when test="Check[@Type='2'][@Cat='1']">
  172.  
  173.     Vulnerabilities
  174.         <xsl:for-each select=".">
  175.             <xsl:apply-templates select="Check[@Type='2'][@Cat='1']">
  176.             </xsl:apply-templates>
  177.         </xsl:for-each>
  178.     </xsl:when>
  179.     </xsl:choose>
  180.     <xsl:choose>
  181.     <xsl:when test="Check[@Type='2'][@Cat='2']">
  182.  
  183.     Additional System Information
  184.         <xsl:for-each select=".">
  185.             <xsl:apply-templates select="Check[@Type='2'][@Cat='2']">
  186.             </xsl:apply-templates>
  187.         </xsl:for-each>
  188.     </xsl:when>
  189.     </xsl:choose>
  190. </xsl:template>
  191.  
  192. <xsl:template match="Check">
  193. <xsl:param name="score" select="@Grade"/>
  194.         Issue:  <xsl:value-of select="@Name"/>
  195.        Score:  <xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$score]/@text"/>
  196.        Result: <xsl:value-of select="Advice"/>
  197.        <xsl:if test="Detail">
  198.           Detail: <xsl:choose>
  199.             <xsl:when test="@Type='5'">
  200.             | <xsl:for-each select="Detail/Head/Col"><xsl:if test="position()=1 or position()!=last()"><xsl:value-of select="."/> | </xsl:if></xsl:for-each>
  201.             <xsl:for-each select="Detail/Row">
  202.  
  203.             <xsl:choose>
  204.             
  205.             <xsl:when test="Col[1]=' ' and Col[2]=' ' and Col[3]!=' '">
  206.             | | <xsl:value-of select="Col[3]"/> |</xsl:when>
  207.             
  208.             <xsl:otherwise>
  209.             | <xsl:for-each select="Col">
  210.                 <xsl:if test="position()=1 or position()!=last()"><xsl:value-of select="."/><xsl:if test="@REQUIREDNAME"> (This update requires <xsl:value-of select="@REQUIREDNAME"/> to be installed first.) </xsl:if> | </xsl:if>
  211.               </xsl:for-each>
  212.             </xsl:otherwise>
  213.             
  214.             </xsl:choose>
  215.  
  216.             </xsl:for-each> 
  217.             </xsl:when>
  218.             <xsl:otherwise>
  219.             | <xsl:for-each select="Detail/Head/Col"><xsl:value-of select="."/> | </xsl:for-each>
  220.             <xsl:for-each select="Detail/Row">
  221.             | <xsl:for-each select="Col"><xsl:value-of select="."/> | </xsl:for-each>
  222.             </xsl:for-each> 
  223.             </xsl:otherwise>
  224.             </xsl:choose>
  225.         </xsl:if>
  226. </xsl:template>
  227. </xsl:stylesheet>
  228.